import requests

url = "http://www.baidu.com/s?wd=爬虫获取响应cookie"
header = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
}
response = requests.get(url, headers=header)
data = response.content.decode('utf-8')
with open('02.html',encoding='utf-8',mode='w') as file:
    file.write(data)


#发送post请求和添加参数
# requests.post(url,data=,json=)